package blog.farb.top.springbootforredis.controller;

import blog.farb.top.springbootforredis.entity.Stock;
import blog.farb.top.springbootforredis.service.StockService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StockController {

    @Resource
    private StockService stockService;

    @GetMapping("/stock/{id}")
    public Stock getStockById(@PathVariable int id) {
        return stockService.getStockById(id);
    }
}
